<template>
    <div>
        <h1 v-show="flag">你来打我呀</h1>
    </div>
</template>

<script>
    import {MessageBox, Toast} from 'mint-ui';

    export default {
        data() {
            return {
                flag:false
            }
        },
        created() {
            MessageBox({
                title: '哭泣',
                message: '我不是你最爱的小甜甜了吗?',
                showCancelButton: true
            }).then(action => {
                if (action !== 'confirm') {
                    this.mess()
                }else {
                    let Willfulness =Toast('既然这样，那就不让你走，哼哼');
                    setTimeout(() => {
                        Willfulness.close();
                    }, 2000);
                    this.flag = true;
                }

            });
        },
        methods: {
            mess() {
                Toast('那就再看看把，从首页开始');
                this.$router.push({path: '/home'});
            }
        }
    }
</script>

<style>

</style>